<template>
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
        <van-swipe-item class="item" v-for="image, index in images" :key="index">
            <img :src="image.img" />
        </van-swipe-item>
    </van-swipe>

</template>

<script setup lang="ts">

import { ref, onMounted } from "vue";

import { lbtData } from "../api/index";

// type lbt = {
//     alt: string
//     link: string
//     img: string
//     bannerid: string
//     flag: boolean
// }
// const images = ref<lbt[]>()
const images = ref()

onMounted(async () => {
    const result = await lbtData()
    console.log(result);
    images.value = result.data.data
    console.log(images.value);

})

</script>

<style scoped>
/* .my-swipe .van-swipe-item {
    color: #fff;
    font-size: 20px;
    line-height: 150px;
    text-align: center;
    background-color: #39a9ed;
} */

img {
    width: 100%;
    object-fit: cover;
}

.item {
    height: 200px;
}
</style>